#include<iostream>
using namespace std;
int main()
{
	int n;
	while (cin >> n) {
		string str, temp;
		cin>>str;
		temp = str + str;
		int pos = temp.find(str, 1);
		cout << pos / n << endl;
	}
	return 0;
}